﻿using System;
using System.Collections.Generic;
using System.Text;

namespace FySystem.Data.OrmA.Attributes
{
    /// <summary>
    /// 主键特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public class FyPrimaryKeyAttribute : FyColumnAttribute
    {
        public PrimaryKeyTypes PrimaryKeyType { get; set; }

        public string Sequence { get; set; }

        public FyPrimaryKeyAttribute(PrimaryKeyTypes primaryKeyType)
        {
            IsPrimaryKey = true;
            PrimaryKeyType = primaryKeyType;
        }

        public FyPrimaryKeyAttribute(PrimaryKeyTypes primaryKeyType, string sequence)
        {
            IsPrimaryKey = true;
            PrimaryKeyType = primaryKeyType;
            Sequence = sequence;
        }
    }
}
